package com.mtf.syncExportExcel.controller;

import com.alibaba.fastjson.JSONObject;
import com.mtf.syncExportExcel.dto.FileExecuteParam;
import com.mtf.syncExportExcel.entity.ExportTaskEntity;
import com.mtf.syncExportExcel.service.impl.ExportServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * 功能描述:<br>
 *
 * @author wx:fdzhangc
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@RequestMapping("/easyexcel")
@RestController
@Slf4j
public class EasyTestController {

    @Autowired
    ExportServiceImpl exportService;

    @GetMapping(value = "/export")
    public JSONObject export() {
        ExportTaskEntity exportTaskBean = new ExportTaskEntity();
        exportTaskBean.setTaskTime(new Date());
        exportTaskBean.setTaskStatus(1);
        Long pkId = 1L;
        exportService.export(pkId);
        JSONObject data = new JSONObject();
        data.put("tips", "导出任务生成成功，请去下载中心查看!");
        return data;
    }
}
